$(function(){
	
	$('.banner').slide({
		titCell:'.hd ul',
		mainCell:'.bd ul',
		autoPage:true,
		autoPlay:true,
		effect:'left',
		prevCell:".banner_prev",
		nextCell:".banner_next",
		trigger:"click",
		delayTime:1000,
		interTime: 2500,
	});
	
	$(".l_inews").slide({
		vis:2,
		mainCell:".bd",
		effect:"leftLoop",
		prevCell:'.inews_prve',
		nextCell:'.inews_next',
	});
	

	$('.jpro').slide({
		mainCell:'.bd ul',
		effect:'left',
		prevCell:".pro_prev",
		nextCell:".pro_next",
	})
	
	
	$('.search_btn').on('click',function(){
		$('.head_form').fadeToggle();
	})
	

	$("[data-fancybox]").fancybox({
		buttons: [
			"zoom",
			"download",
			"close"
		],
		animationEffect: "fade",
	});
	
	
	
	$('.phonor').slide({
		vis:'4',
		trigger:"click",
		mainCell:'.bd ul',
		titCell:'.hd ul',
		effect:'leftLoop',
		autoPage:true,
		prevCell:".hon_prev",
		nextCell:".hon_next",
	})
	
	
	$('.det h2').on('click',function(){
		let $h2=$(this);
		$h2.toggleClass('on')
		let $txt=$h2.next();
		$txt.slideToggle();
	})
	
	var swiper = new Swiper('.jpro .swiper-container', {
	  direction: 'vertical',
	  slidesPerView: 'auto',
	  freeMode: true,
	  scrollbar: {
		el: '.swiper-scrollbar',
	  },
	  mousewheel: true,
	});
	
	let job = $('.job .hd');
	job.each(function(){
		$(this).on('click', function(){
			$(this).parent().siblings().find('.bd').slideUp();
			$(this).parent().find('.bd').slideToggle();
			$(this).parent().siblings().find('.hd').removeClass('on');
			$(this).toggleClass("on");
		});
	});
	
	
	// 列表
	$(".select_box").click(function(e){   
		$(this).toggleClass('on').siblings().removeClass('on').find('.option').hide();
		e.stopPropagation();
		$(this).find(".option").slideToggle(200);
		$(this).parent().siblings().find(".option").hide();
	});
	
	
	/*赋值给文本框*/
	$(".option a").click(function(){
		var value=$(this).text();
		$(this).parent().siblings(".select_txt").text(value);
		$("#select_value").val(value)
	 })
	// 
	
	// 点击其它元素，取消当前状态
	$(document).on("click",function(e){
		var target = $(e.target);
			//点击class为parentId之外的地方触发
		if(target.closest(".select_box").length == 0){$(".select_box").removeClass('on');}
		
		if($(".select_box").is(":visible") && target.attr("class")!="option" && !target.parent(".option").length)
		$('.option').hide();
	})
		
		
})